package com.my.aslife.mapper;

import com.my.aslife.module.common.Condition;
import com.my.aslife.module.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.my.aslife.module.entity.dtos.DeductMoneyDto;
import com.my.aslife.module.entity.dtos.UserNickDto;
import com.my.aslife.module.entity.dtos.UserTypeDto;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Value;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author yuan.ma
 * @since 2022-12-12
 */
public interface UserMapper extends BaseMapper<User> {

    Integer getUserNameFlag(@Value("userName") String userName);
    boolean updateLoginTime(LocalDateTime time, String userName);

    List<User> getUserInfoByPage(Integer current, Integer pageSize, Condition condition);

    int getQueryCount(@Param("condition") Condition condition);

    boolean changeUserStatus(Integer uid);

    void deleteBatchByIds(List ids);

    void changeUserType(@Param("userTypeDto") UserTypeDto userTypeDto);

    UserTypeDto getUserTypeByUID(@Param("uid") Integer uid);

    void updatePassword(@Param("user") User user);

    User queryUserByUserName(String userName);

    void changeUserNickByUID(UserNickDto userNickDto);

    void deductMoney(@Param("deductMoneyDto") DeductMoneyDto deductMoneyDto);

    void setUserIllegalStatus(Long uid);

    List<User> getUserListByUIDs(List<Long> ids);

    void txMoney(User user);

    void jiaMoney(User user);

    void addUserInfo(User user);

    void updateUserRunner(User user);
}
